home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / djgpp / include / qdirent.h < prev    next >
C/C++ Source or Header  |  1994-08-11  |  2KB  |  77 lines

  1. /* Converted to qdirent.h for R5tkt by DMD - 4/22/94 */
  2.  
  3.  
  4. #ifndef __DIRENT_H__
  5. #define __DIRENT_H__
  6.  
  7.  
  8. #ifdef __GO32__
  9. #include <dirent.h>
  10. #include <dir.h>
  11. #define find_t ffblk
  12. #define _dos_findfirst(a,b,c) findfirst(a,c,b)
  13. #define _dos_findnext(a)  findnext(a)
  14. #define _dos_getfileattr(a,b) getfileattr(a,b)
  15. #endif
  16.  
  17. #include <dos.h>
  18.  
  19. #define MAXNAMLEN    12        /* maximum filename length */
  20.  
  21. struct qdirent {
  22.    short d_attr;
  23. #define d_attrib d_attr
  24.    short d_namlen;
  25.    char d_name[MAXNAMLEN + 1];
  26. };
  27.  
  28.  
  29. typedef struct _DIR /* Tagged. POHC 90/10/09 */
  30.     {
  31.     unsigned short    dd_nentry;    /* current entry in directory */
  32.     unsigned short    dd_valid;    /* whether entry is valid */
  33.     struct find_t    dd_find_t;    /* directory entry */
  34.     struct qdirent    dd_dirent;    /* alternative directory entry */
  35.     }    qDIR;            /* stream data from opendir() */
  36.  
  37. extern qDIR        *qopendir(char *dirname);
  38. extern struct qdirent    *qreaddir(qDIR *dp);
  39. extern int        qclosedir(qDIR *dp);
  40.  
  41. #ifndef NO_PROTO
  42.  
  43. #ifdef __cplusplus                      /* for C++ V2.0 */
  44.   extern "C" {   /* do not leave open across includes */
  45. #endif /* __cplusplus */
  46.  
  47. typedef int (*_Sortfunc) (
  48. #if NeedFunctionPtrPrototypes
  49.     const void *,
  50.     const void *
  51. #endif
  52. );
  53.  
  54. typedef int (*_Selectfunc) (
  55. #if NeedFunctionPtrPrototypes
  56.     struct qdirent *
  57. #endif
  58. );
  59.  
  60. int scandir(const char *, struct qdirent ***, _Selectfunc *, _Sortfunc *);
  61. int alphasort(const void *, const void *);
  62.  
  63. #ifdef __cplusplus                      /* for C++ V2.0 */
  64.   }
  65. #endif /* __cplusplus */
  66.  
  67. #else /* NO_PROTO */
  68.  
  69. int scandir();
  70. int alphasort();
  71.  
  72. #endif /* NO_PROTO */
  73.  
  74.  
  75. #endif /* __DIRENT_H_ */
  76.  
  77.